﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.销售记录.service;
using mendian;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.UC.生产计划类型分类管理下单.通用service
{
    public class CommonService
    {

        /// <summary>
        /// 选择定制下单客户
        /// </summary>
        public static CustomerChooseInfoDTO getCustomerChooseInfoDTOById(String customerId, String addressId, String customerCountId)
        {
            return
                FunctionHelper.JsonDeserialization<CustomerChooseInfoDTO>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/order/commonCustomerChoice/getCustomerChooseInfoDTOById" +
                                    "?customerId=" + customerId +
                                    "&addressId=" + addressId +
                                    "&countId=" + customerCountId
                                    )
                    );
        }
        /// <summary>
        /// 查询销售订单所有交货方式
        /// </summary>
        public static List<DTO销售表头> getAllFetchStyle()
        {
            return
                FunctionHelper.JsonDeserialization<List<DTO销售表头>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/order/commonCustomerChoice/getAllFetchStyle"
                                    )
                    );
        }
        /// <summary>
        /// 查询销售订单所有付款方式
        /// </summary>
        public static List<DTO销售表头> getAllPayStyle()
        {
            return
                FunctionHelper.JsonDeserialization<List<DTO销售表头>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/order/commonCustomerChoice/getAllPayStyle"
                                    )
                    );
        }
        /// <summary>
        /// 查询销售订单所有销售方式
        /// </summary>
        public static List<DTO销售表头> getAllSaleType()
        {
            return
                FunctionHelper.JsonDeserialization<List<DTO销售表头>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/order/commonCustomerChoice/getAllSaleType"
                                    )
                    );
        }

    }
}
